home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 4 / Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso / Development / General / Kamprath's CDEF Pack ƒ / ICN# Pushbutton CDEF / ICN# Pushbutton Description next >
Text File  |  1993-10-17  |  4KB  |  103 lines

  1.  
  2.  ICN# Push Button CDEF
  3.  by Michael F. Kamprath
  4.  
  5.  Copyright © 1993 by Michael F. Kamprath
  6.  
  7. Requirments:
  8. ============
  9.  
  10. This CDEF can only be used with system 7.0 or later.  This is because
  11. this CDEF uses System 7's Color Icon family manager.
  12.  
  13. Description
  14. ===========
  15.  
  16. This CDEF uses an icon family setup in a program's resource
  17. fork to define how a push button will look in each of it's
  18. three states: 1) Button up & disengaged, 2) Button up & engaged,
  19. and 3) Button depressed.  This CDEF uses icon families starting with
  20. id's 1000 (potentially) through 1047 in set's of three.  This first of
  21. each set is the icon used for the button up & disengaged, the second
  22. for button up & engaged, and the third for button depressed. 
  23.  
  24. This CDEF can be used with up to 16 different button's at the 
  25. same time.  This is done through the variation code used when creating
  26. the control.  The icon family set used for a particular variation code 
  27. starts at the base ICN# ID for this CDEF (1000) plus 3  times the variation
  28. code.  For example, if the ICN# CDEF is in CDEF resource 
  29. id 1000, and uses a variation code of 2, then when one create's a controls 
  30. with the command:
  31.  
  32.      hCtl = NewControl( theWindow, &ctrlRect, title, visible, 
  33.                         initialValue, min, max, 1000*16 + 2, refCon );
  34.  
  35. Would use the following ICN# id's for:
  36.      1006 ==> Button up & disengaged
  37.      1007 ==> Button up & engaged
  38.      1009 ==> Button down 
  39.  
  40. Recall that the resource ID of the CDEF used much be multiplied by 16 for 
  41. the proper bit shift for the control manager.  This effectly means that
  42. this CDEF can be used for up to 16 different icon pushbuttons.
  43.  
  44. The button is considered engaged when it's control value is something other
  45. than zero.  
  46.  
  47. There are only two hilite states your code needs to manage for this CDEF.
  48. A hilite state of 0 means the control is useable, and a hilite state of 255
  49. is the "dimmed" state of the control.  DO NOT set the hilite state to anything
  50. other than these two states for it will cause the button to be in it's 
  51. "depressed" mode.
  52.  
  53. NOTEs: 
  54.  
  55. 1. Proper definition of the icon family's (ICN#) mask is a must because this
  56. CDEF uses the mask to determine if a test point is in the control.  Be sure to use
  57. the same mask for each icon in a button's set to ensure proper updating of the button.
  58.  
  59. 2. You must define the control rect to be either 32x32 or 16x16.  If you define
  60. the control rect as 32x32, then the proper ICN# family will be used.  If you
  61. use a control rect of 16x16, then the proper icn# family will be used.  This
  62. is inherent to System 7's icon plotting routine's.
  63.  
  64. 3. If you want the color version of your icon family's to be used, you must use
  65. a color window or dialog.  System 7's icon plotting routine automatically plot's
  66. the correct icon for the current monitor depth.
  67.  
  68. Shareware Info:
  69. ===============
  70.  
  71. If you use this CDEF for personal use, all I ask is that you send me a note
  72. and maybe a copy of the program you use it in.
  73.  
  74. If you use this CDEF for somethiong that you later charge money for (like
  75. your own shareware software or commercial software), the price for it's use
  76. is a one time payment of $5 and maybe a copy of your program.  If you don't 
  77. wish to give me a free copy of your program, I understand (after all, I'm 
  78. asking for money).
  79.  
  80. If you wish for the source code to this CDEF, I will send it to you if you
  81. include a disk with your shareware payment ($5).  I will not send the source
  82. code out with out the shareware payment or the disk (though I will send it
  83. via e-mail if you send me the shareware payment before I lose my e-mail
  84. account).
  85.  
  86. Please make all payments in U.S. funds.
  87.  
  88. You may contact me by:
  89.  
  90.      e-mail:      kamprath@engin.umich.edu  (valid until Jan, 1994)
  91.  
  92.      postal mail: Michael F. Kamprath
  93.                   481 NW Eleventh Ave.
  94.                   Boca Raton, FL  33486
  95.                   
  96. Legal Stuff
  97. ===========
  98.  
  99. I provide no warranty, written or implied, nor do I accept any responsibility
  100. for damages inflicted, real or imagined, by the use of this CDEF.
  101.  
  102. This CDEF was wrriten in THINK C v5.0.  Therefore, some portions are copyrighted 
  103. by Symantec.